
<div class="grid_7">
    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">CAR MODEL MANAGEMENT : <?= $this->management_model->get_make('CAR', $company_id)->make; ?></a>
        </h2>
        <div class="block" >
            <form name="admin-form" action="<?= base_url(); ?>admin/management/model_insert" method="post">
                <fieldset>
                    <legend>MODEL : NEW </legend>
                    <?php
                    if ($this->session->flashdata('message')) {
                        $msg = $this->session->flashdata('message');
                        echo '<font color="red">' . $msg . '</font>';
                    }
                    ?> 
                    <div class="field" style="float:left" >
                        <label> Model Name</label>
                        <input type="text" size="50" name="model" onfocus="if(this.value=='Enter Model')this.value='';" 
                               onblur="if(this.value=='')this.value='Enter Model';" value="Enter Model"/>
                        <input type="hidden" name="company_id" value="<?= $company_id; ?>" />

                        <input type="submit" value="Add Model" name="insert" />
                    </div>

                    <div style="float:right;">
                        <?php
                        $img = $this->management_model->get_make_image('CAR', $company_id);
                        if ($img != '') {
                            ?>
                            <img style="border: 1px solid #CCC; padding: 3px" src="<?= base_url() ?>assets/images/data/car/company/<?= $img; ?>" height="75" width="188" align="center" />
                        <?php } ?>
                    </div>

                </fieldset>
            </form>
        </div>
    </div> <!-- END OF BOX -->
    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">MODEL LIST : <?= $this->management_model->get_make('CAR', $company_id)->make; ?></a>
        </h2>
        <div class="block" >
            <fieldset>
                <legend>List :</legend>
                <?php foreach ($model as $model): ?>
                    <div class="field">
                        <form name="update_make" action="<?= base_url(); ?>admin/management/model_update" method="post"> 
                            <input type="hidden" size="0" name="model_id" value="<?= $model->id; ?>" />
                            <input type="hidden" size="0" name="make_id" value="<?= $model->make_id; ?>" />
                            <input type="text" size="50" name="model_detail" value="<?= $model->model; ?>" />
                            <input type="submit" value="Update" name="update_model" />
                            <div id="link-button" style="float: right">
                                <a href="<?= base_url(); ?>admin/management/model_delete/<?= $model->id; ?>/<?= $model->make_id; ?>" class="link-button" onclick="return confirm('Are you sure you ...')"> Delete </a>
                                <a href="<?= base_url(); ?>admin/management/version/<?= $model->make_id; ?>/<?= $model->id; ?>" class="link-button"> View Version </a>
                            </div>
                        </form>
                    </div>
                <?php endforeach; ?>
            </fieldset>
        </div>
        <div class="pagination" align="left"> <?php echo $this->pagination->create_links(); ?>  </div>
    </div> <!-- END OF BOX -->
</div>